<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    用户名： <input type="text">
    <p></p>
    
    <script>
         const inp = document.querySelector('input')
         const p = document.querySelector('p') 
        var val = inp.value;
        function fn(a) {
             inp.style.border = '1px solid red';
             p.innerHTML = a.msg 
         }
         inp.addEventListener('blur',function() { 
             // 1 创建stript标签
             const script = document.createElement('script');
             // 2.设置src属性
             script.src= 'http://localhost:3000/jsonp';
             document.body.appendChild(script)
         })
     </script>
</body>
</html>